import Vue from 'vue';
import Router from 'vue-router';

Vue.use(Router);

export default new Router({
    routes: [
        {
            path: '/',
            redirect: '/dashboard'
        },
        {
            path: '/',
            component: () => import('../components/common/Home.vue'),
            meta: { title: '自述文件' },
            children: [
                {
                    path: '/dashboard',
                    component: () => import('../components/page/Dashboard.vue'),
                    meta: { title: '系统首页' }
                },
                {
                    path: '/druid',
                    component: () => import('../components/page/Druid.vue'),
                    meta: { title: 'Druid监控' }
                },
                {
                    path: '/userinfo',
                    component: () => import('../components/page/UserInfo.vue'),
                    meta: { title: '个人信息' }
                },
                {
                    path: '/userlist',
                    component: () => import('../components/page/UserTable.vue'),
                    meta: { title: '用户管理' }
                },
                {
                    path: '/loglist',
                    component: () => import('../components/page/Syslog.vue'),
                    meta: { title: '系统日志' }
                },
                {
                    path: '/rolelist',
                    component: () => import('../components/page/RoleTable.vue'),
                    meta: { title: '角色管理' }
                },
                {
                    path: '/classtable',
                    component: () => import('../components/page/ClassTable.vue'),
                    meta: { title: '班级管理' }
                },
                {
                    path: '/coursetable',
                    component: () => import('../components/page/CourseTable.vue'),
                    meta: { title: '课程管理' }
                },
                {
                    path: '/examtable',
                    component: () => import('../components/page/ExamTable.vue'),
                    meta: { title: '考试列表' }
                },
                {
                    path: '/testedtable',
                    component: () => import('../components/page/ExamIsTested.vue'),
                    meta: { title: '已考列表' }
                },
                {
                    path: '/needcheck',
                    component: () => import('../components/page/ExamNeedCheck.vue'),
                    meta: { title: '待考列表' }
                },
                {
                    path: '/proctor',
                    component: () => import('../components/page/Procte.vue'),
                    meta: { title: '监考' }
                },
                {
                    path: '/scoring',
                    component: () => import('../components/page/Scoring.vue'),
                    meta: { title: '阅卷' }
                },
                {
                    path: '/proctorlog',
                    component: () => import('../components/page/ProctorLog.vue'),
                    meta: { title: '监考日志' }
                },
                {
                    path: '/questiontable',
                    component: () => import('../components/page/QuestionTable.vue'),
                    meta: { title: '题库' }
                },
                {
                    path: '/exampapertable',
                    component: () => import('../components/page/ExamPaperTable.vue'),
                    meta: { title: '试卷列表' }
                },
                {
                    path: '/404',
                    component: () => import('../components/page/404.vue'),
                    meta: { title: '页面丢失' }
                }
            ]
        },
        {
            path: '/login',
            component: () => import(/* webpackChunkName: "login" */ '../components/page/Login.vue'),
            meta: { title: '登录' }
        },
        {
            path: '*',
            redirect: '/404'
        }
    ]
});
